<div style="height: 200px; overflow: auto; "><table><?

  $oneDay = 60*60*24;

  $chars = DB_GetList('SELECT *FROM `'.getTablename('users').'`  
    WHERE u_lastsync > 0 AND u_fb_name != "" AND u_lastsync < '.(time()-($oneDay*30)).'
    ORDER BY `u_lastsync`  DESC');
    
  $flds = explode(',', 'u_key,u_fb_name,u_lastsync,u_fb_uid');
    
  foreach($chars as $c)
  {
    ?><tr><?
    foreach($flds as $fname)
    {
      $cell = $c[$fname];
      if ($fname == 'u_lastsync') $cell = date('Y-m-d', $cell);
      ?><td><?= $cell ?></td><?
    }
    $usrList[] = $c['u_fb_uid'];
    ?></tr><?
  }

?></table></div>
<form method="post" action="gm/notifications/do/send">
  <textarea name="notext"><?= htmlentities(getDefault($_REQUEST['notext'], '<a href="http://apps.facebook.com/nerdquest/default/index">Popsickles of Nerdia</a>')) ?></textarea>
  <input type="checkbox" name="testsend" value="Y" checked/> send test
  <input type="submit"/>
</form>
<?
if ($_REQUEST['do'] == 'send')
{
  #print_r($usrList);
  #
  if ($_REQUEST['testsend'] == 'Y')
    print_r($this->user->fb->api_client->notifications_send(array('597325803'), $_REQUEST['notext'], 'app_to_user'));
  else
    print_r($this->user->fb->api_client->notifications_send($usrList, $_REQUEST['notext'], 'app_to_user'));
}
?>